package day1202friut;

public class FruitModel1 implements Comparable<FruitModel1>{
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getInventory() {
		return inventory;
	}
	public void setInventory(int inventory) {
		this.inventory = inventory;
	}
	public int getSoldnumber() {
		return soldnumber;
	}
	public void setSoldnumber(int soldnumber) {
		this.soldnumber = soldnumber;
	}
	public double getCostprice() {
		return costprice;
	}
	public void setCostprice(double costprice) {
		this.costprice = costprice;
	}
	public double getSaleprice() {
		return saleprice;
	}
	public void setSaleprice(double saleprice) {
		this.saleprice = saleprice;
	}
	public void addInventory(int inventory) {
		this.inventory += inventory;
	}
	public void subtractInventory(int inventory) {
		this.inventory -= inventory;
	}
	public void addSoldNumber(int number) {
		this.soldnumber += number;
	}
	public  FruitModel1(String name,Double saleprice,Double costprice) {
		this.name = name;
		this.saleprice = saleprice;
		this.costprice = costprice;
	}
	public FruitModel1() {
		
	}
	public void addTotalCount(int number) {
		this.totalcount += number;
	}
	public int getTotalCount() {
		return this.totalcount;
	}
	public void halfprice() {
		this.saleprice = this.saleprice/2.0;
	}
	public void doubleprice() {
		this.saleprice = this.saleprice*2;
	}
	public void femalprice() {
		this.saleprice = this.saleprice*0.8;
	}
	public void returnprice() {
		this.saleprice = this.saleprice/0.8;
	}
	public void addTotalPrice(double price) {
		this.totalprice += price;
	}
	
	public double getTotalprice() {
		return totalprice;
	}
	public void setTotalprice(double totalprice) {
		this.totalprice = totalprice;
	}
	public int getTotalcount() {
		return totalcount;
	}
	public void setTotalcount(int totalcount) {
		this.totalcount = totalcount;
	}

	private String name;//水果名字
	private int inventory=0;//库存数量
	private int soldnumber = 0;//累计卖出的数量
	private double totalprice = 0;//累计卖出的价格
	private int totalcount=0;//累计进货数量
	private double inprice;//累计进货价格
	public double getInprice() {
		return inprice;
	}
	public void setInprice(double inprice) {
		this.inprice = inprice;
	}
	public void addInprice(double price) {
		this.inprice += price;
	}
	private double costprice;//成本单价
	private double saleprice;//出售价格
	@Override
	public int compareTo(FruitModel1 o) {
		// TODO Auto-generated method stub
		return o.getSoldnumber()-this.getSoldnumber();
	}

}
